home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 September
/
PCWorld_2006-09_cd.bin
/
v cisle
/
hexer
/
mpth_17.exe
/
{app}
/
scripts
/
Checksums.mps
< prev
next >
Wrap
Text File
|
2006-05-20
|
1KB
|
49 lines
include '*.lng'
include 'def.mps'
include 'checksums_file.mps'
= create crc16, crc32 and md5 checksum of the current file
= ensure a current file is available
if currentfile==''
if PARAM_COUNT > 0
!cmd.fileopen PARAMS(0)
else
!cmd.fileopen
endif
if currentfile==''
end
endif
endif
var fin file
fin=fileopen('::current', 'r')
var fStart dword fCount dword
fStart=0
fCount=filesize(fin)
= check if a selection is available
if filegetprop(fin, 'selcount') != 0
var mb dword
mb = msgbox(__SELQ__, MB_ICONQUESTION or MB_YESNOCANCEL)
if mb == IDCANCEL: end:endif
if mb == IDYES
fStart = filegetprop(fin, 'selstart')
fCount = filegetprop(fin, 'selcount')
endif
endif
fileclose fin
= call the checksum subroutines
var msg text
concat msg (__SUM8S__+":\r\n "+HEX(#filesum8('::current', fStart, fCount))+"\r\n\r\n")
concat msg (__CRC16S__+":\r\n "+#filecrc16('::current', fStart, fCount)+"\r\n\r\n")
concat msg (__CRC32s__+":\r\n "+#filecrc32('::current', fStart, fCount)+"\r\n\r\n")
concat msg (__MD5S__+":\r\n "+#filemd5('::current', fStart, fCount)+"\r\n\r\n")
textbox msg, __CSUMS__